﻿
--DECLARE		@RunId  INT = 3
--		,@StartOffset INT = 5
--		,@EndOffset INT = 120
--		,@NameFilter nvarchar(255) = '%'
--		,@NumberOfRows INT = 25

--	SELECT
--		c.PageId
--		,d.RequestUri
--		,COUNT(DISTINCT (c.PageDetailId)) AS Qty
--		--(CASE a.Outcome WHEN 0 THEN 'Passed' ELSE 'Failed' END) AS Outcome
--		,CASE @StartOffset WHEN NULL THEN
--			CAST((COUNT(DISTINCT (c.PageDetailId)))/b.RunDuration AS Decimal(15,2))
--			ELSE (COUNT(DISTINCT (c.PageDetailId)))/(@EndOffset - @StartOffset) END 
--		AS Throughput
--		,CAST(MIN(c.ResponseTime) AS Decimal(15,2)) AS Minimum
--		,CAST(AVG(c.ResponseTime) AS Decimal(15,2)) AS Average
--		,CAST(MAX(c.ResponseTime) AS Decimal(15,2)) AS Maximum
--		,CAST(STDEV(c.ResponseTime) AS Decimal(15,2)) AS StdDev
--	FROM 
--		dbo.LoadTestTestDetail AS a
--	INNER JOIN 
--		LoadTestRun AS b 
--		ON a.LoadTestRunId = b.LoadTestRunId
		
--	INNER JOIN dbo.LoadTestPageDetail AS c 
--		ON a.LoadTestRunId = c.LoadTestRunId 
--		AND a.TestDetailId = c.TestDetailId
--		AND c.Outcome = 0

--	INNER JOIN dbo.WebLoadTestRequestMap AS d
--		ON a.LoadTestRunId = d.LoadTestRunId
--		AND c.PageId = d.RequestId
--	WHERE 
--		a.LoadTestRunId = @RunId
--		AND (@StartOffset IS NULL OR c.EndTime >= DATEADD(second, @StartOffset, b.StartTime))
--		AND (@EndOffset IS NULL OR c.EndTime < DATEADD(second, @EndOffset, b.StartTime))
--		AND d.RequestUri LIKE @NameFilter
--		AND (c.Outcome = 0) 
--		AND (a.InMeasurementInterval = 1) 
--	GROUP BY d.RequestUri, c.PageId, b.RunDuration
--GO
SELECT 1 GO

-- Use this to get list of all reporting tool stuff
SELECT [name] FROM sys.objects WHERE name LIKE 'VSLT_%' ORDER BY [type],name ASC
GO

